package com.bee.tlweb.view;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.beetl.ext.servlet.ServletGroupTemplate;

import com.bee.tlweb.model.News;
import com.bee.tlweb.service.PortalService;

/**
 * Servlet implementation class HelpServlet
 */
public class HelpServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public HelpServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html;charset=UTF-8"); 
		
		
		PortalService portalService = new PortalService();
		List<News> list = portalService.getNews(News.HELP_NEWS);		
		request.setAttribute("helpList", list);
		ServletGroupTemplate.instance().render("/help.html", request, response);
	}

}
